import { Context } from "koa";
import fs from "fs";

class ResourceController {
    async index(ctx: Context) {
        let name = ctx.params.name
        let filePath = `./resource/${name}`
        let file = fs.readFileSync(filePath)
        ctx.response.type = 'png'
        ctx.body = file
    }
}

export default new ResourceController